<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>权限管理系统-登录</title>
    <link rel="stylesheet" type="text/css" href="/static/js/bootstrap/css/bootstrap.css">
    <link rel="stylesheet" type="text/css" href="/static/js/font-awesome/css/font-awesome.min.css">
    <link rel="stylesheet"type="text/css" href="/static/js/Ionicons/css/ionicons.min.css">
    <link rel="stylesheet" type="text/css"href="/static/js/adminlte/css/AdminLTE.min.css">
    <link rel="stylesheet" type="text/css" href="/static/js/adminlte/css/skins/_all-skins.min.css">
    <link rel="stylesheet"type="text/css" href="/static/js/adminlte/css/fonts.googleapis.com.css">

    <script src="/static/js/jquery/jquery.min.js" type="text/javascript"></script>
    <script src="/static/js/bootstrap/js/bootstrap.js" type="text/javascript"></script>
    <script src="/static/js/adminlte/js/adminlte.min.js" type="text/javascript"></script>
    <script src="/static/js/plugins/twbsPagination/jquery.twbsPagination.min.js" type="text/javascript"></script>
    <script src="/static/js/system/commonAll.js" type="text/javascript"></script>
    <script src="/static/js/plugins/jqueryMessage/jquery.bootstrap.min.js" type="text/javascript"></script>
    <script src="/static/js/plugins/jqueryForm/jquery.form.min.js" type="text/javascript"></script>


</head>
<body class="hold-transition login-page">
<div class="login-box">
    <div class="login-logo">
        <a href="#"><b>RBAC</b>权限管理</a>
    </div>
    <!-- /.login-logo -->
    <div class="login-box-body">
        <p class="login-box-msg">请输入账号密码</p>
        <form  method="post" id="loginForm" action="/login">
            <div class="form-group has-feedback">
                <input type="text" class="form-control" placeholder="请输入账号" name="username" value="admin">
                <span class="glyphicon glyphicon-envelope form-control-feedback"></span>
            </div>
            <div class="form-group has-feedback">
                <input type="password" class="form-control" placeholder="请输入密码" name="password" value="admin">
                <span class="glyphicon glyphicon-lock form-control-feedback"></span>
            </div>
            <div class="row">

                <div class="col-xs-12">
                    <button type="submit" class="btn btn-primary btn-block btn-flat submitBtn">登录</button>
                </div>
            </div>
        </form>
    </div>

</div>
<script type="text/javascript">
    $(function(){
        $("#loginForm").ajaxForm({
            beforeSubmit:validate,
            clearForm:true,
            success:function(rs){
                if(rs.code == 1000){  //登录成功
                   // $.messager.popup(rs.msg);
                    location.href="/index";
                }else{
                    $.messager.alert(rs.data);
                }
            }
        });

        function validate(formData, jqForm, options) {
            for (var i=0; i < formData.length; i++) {
                if (!formData[i].value) {
                    $.messager.alert('请输入用户名和密码');
                    $(jqForm).reset();
                    return false;
                }
            }
            return true;
        }
    });
</script>
</body>
</html>